<?php
namespace app\index\controller;
use think\Controller;

class Form extends Controller
{
    public function add()
    {
        $id = I('get.form');
        $type = I('get.type');
        if(I('?post.form_id'))
            $id = I('post.form_id');
        $term = term($id);
        while(isset($term['child'])&& isset($term['child'][0]['id'])){
            $id = $term['child'][0]['id'];
            $term = term($id);
        }
        if(empty($id))
            return false;
        if($type=='content')
            return D('Form')->addContent($id);
        return false;
    }
}
